<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const Person = function Human () {};
      /*
        ① 类表达式定义等价函数表达式定义
        ② 变量名和类名同时存在，此时类名是局部变量只能在类的内部访问，外部无法访问，类名和变量名同时指向当前类
      */
      const Person = class Human {
        constructor() {
          console.log(Human === Person);
          this.username = "jack";
        }
        say() {
          console.log("hello jack");
        }
      };
      const p1 = new Person();
      const p2 = new Person();
      console.log(p1.say === p2.say);
    </script>
  </body>
</html>
